home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / lib / KeySortCltn.h < prev    next >
C/C++ Source or Header  |  1990-05-19  |  2KB  |  71 lines

  1. #ifndef KEYSORTCLTNH
  2. #define KEYSORTCLTNH
  3.  
  4. /* KeySortCltn.h -- header file for class KeySortCltn
  5.  
  6.     THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
  7.     "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
  8.     AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
  9.     CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
  10.     PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
  11.     RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
  12.  
  13. Author:
  14.     S. M. Orlow
  15.     Systex, Inc.
  16.     Beltsville, MD 20705
  17.  
  18. Contractor:
  19.     K. E. Gorlen
  20.     Computer Systems Laboratory, DCRT
  21.     National Institutes of Health
  22.     Bethesda, MD 20892
  23.  
  24. Modification History:
  25.  
  26. $Log:    KeySortCltn.h,v $
  27.  * Revision 3.0  90/05/20  00:19:59  kgorlen
  28.  * Release for 1st edition.
  29.  * 
  30. */
  31.  
  32. #include "SortedCltn.h"
  33. #include "LookupKey.h"
  34.  
  35. class Assoc;
  36.  
  37. class KeySortCltn: public SortedCltn {
  38.     DECLARE_MEMBERS(KeySortCltn);
  39. #ifndef BUG_38
  40. // internal <<AT&T C++ Translator 2.00 06/30/89>> error: bus error (or something nasty like that)
  41. protected:        // storer() functions for object I/O
  42.     virtual    void storer(OIOofd& fd)    const    { SortedCltn::storer(fd); };
  43.     virtual    void storer(OIOout& strm) const    { SortedCltn::storer(strm); };
  44. #endif
  45. public:
  46.     KeySortCltn(int size =DEFAULT_CAPACITY);
  47. #ifndef BUG_TOOBIG
  48. // yacc stack overflow
  49.     KeySortCltn(const KeySortCltn&);
  50. #endif
  51.  
  52.     LookupKey* assocAt(int i);
  53.     Object* keyAt(int i);
  54.     Object* valueAt(int i);
  55.     Object* atKey(Object& key);
  56.  
  57.     Assoc* addAssoc(Object& key,Object& val);
  58.     Collection& addValuesTo(Collection&) const;
  59.     Collection& addKeysTo(Collection&) const;
  60.     Collection& addContentsBeforeTo(Object&,Collection&);
  61.  
  62.     virtual void deepenShallowCopy();
  63.     virtual int findIndexOf(Object& key) const;
  64.     virtual Range findRangeOfKey(Object& key) const;
  65.     virtual bool includesKey(Object& key) const;
  66.     virtual int occurrencesOfKey(const Object& key) const;
  67.     virtual Object* removeKey(Object& key);
  68. };
  69.  
  70. #endif
  71.